<!DOCTYPE html>
<html>
{include file="public/head"}

<body>
    {include file="contest/contest-nav"}
    <br/>
    
    </div>
    <div class="layui-row">
        <div class="layui-col-lg8">
            <div class="fly-panel contest-discuss-8">
                <div >
                    <div style='text-align: center;'><span class="layui-badge layui-bg-blue">{$label}</span></div>
                    <div class="content-discuss-reply">
                        <div class="content-discuss-reply-conten">{$discuss.content}</div>
                        <div class="content-discuss-reply-user">用户ID:<a href="{:url('web/account/info',['user_id'=>$discuss.user_id])}">{$discuss.user_id}</a></div>
                    </div>
                    <hr />
                </div>
                <div id="reply">
                    
                </div>
                <div>
                    <form method="post" action='{:url("web/Contestdiscuss/post_reply",['id'=>$id])}'>
                          <textarea id='content' name="content" class="layui-hide"></textarea>
                        <div id="content-ed"></div>
                        <input name="cid" value="{$cid}" class='layui-hide' />
                        <br />
                        <button class="layui-btn" type="submit" style="float: right;">回复一下</button>
                    </form>
                </div>
            </div>
        </div>
        <div class="layui-col-lg4">
            <div class="fly-panel contest-discuss-4">
                <div style="text-align: center;">
                    <a class="layui-btn layui-inline" href="{:url('web/Contestdiscuss/post_discuss',['cid'=> $cid])}">发起提问</a>
                </div>
            </div>
        </div>
    </div>
    
    

    </div>
    
     {include file="public/foot"}
	 {include file="contest/post-notice"}
</body>
<script>
    layui.use(['jquery','form','element'],function(){
        var form=layui.form;
        var $=layui.jquery;
        var element=layui.element;
        form.render();      
    });
</script>
<script type="text/javascript" src="__STATIC__/WE/wangEditor.min.js"></script>
<script>
layui.use(['jquery','flow'],function(){
    var $=layui.jquery;
    var flow=layui.flow;
    flow.load({
    elem: '#reply' //指定列表容器
    ,isAuto:false
    ,done: function(page, next){ //到达临界点（默认滚动触发），触发下一页
      //以jQuery的Ajax请求为例，请求下一页数据（注意：page是从2开始返回）
      $.get('/api/contest-discuss-reply-{$cid}-{$id}-'+page, function(res){
        next(res.html, page < res.pages);
      });
    }
  });
});
layui.use(['form','jquery'],function(){
    var $=layui.jquery;
    
    var E = window.wangEditor;  
        var editor = new E('#content-ed');
        var $text1 = $('#content');
        editor.customConfig.onchange = function (html) {
            // 监控变化，同步更新到 textarea
            $text1.val(html);
        };
        editor.customConfig.zIndex = 0;
       
        editor.customConfig.menus = [
        'head',  // 标题
    'bold',  // 粗体
    'fontSize',  // 字号
    'fontName',  // 字体
    'italic',  // 斜体
    'underline',  // 下划线
    'strikeThrough',  // 删除线
    'foreColor',  // 文字颜色
    'backColor',  // 背景颜色
    'link',  // 插入链接
    'list',  // 列表
    'justify',  // 对齐方式
    'quote',  // 引用
    'image',  // 插入图片
    'table',  // 表格
    'video',  // 插入视频
    'code',  // 插入代码
    'undo',  // 撤销
    'redo'  // 重复
    ];
        editor.create();
        $('.w-e-text-container').attr('style','border:1px solid #ccc; border-top:none; height:150px;');
        $text1.val(editor.txt.html());
});

</script>



</html>